package com.twotiger.and.adapter;

import java.util.List;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.twotiger.and.activity.base.AbastractListItem;
import com.twotiger.and.activity.base.BaseActivity;
import com.twotiger.and.activity.base.BaseListItem;

public class BaseListAdapter extends BaseAdapter {

    protected BaseActivity mActivity;
    protected List<AbastractListItem> datas;

    public BaseListAdapter() {
    	
    }

    public BaseListAdapter(BaseActivity mActivity, List<AbastractListItem> datas) {
        this.mActivity = mActivity;
        this.datas = datas;
    }

    @Override
    public int getCount() {
        return datas.size();
    }

    @Override
    public Object getItem(int position) {
        return datas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        AbastractListItem item = datas.get(position);
        return item.getView(mActivity, position, convertView, parent);
    }

}
